package com.example.ntier.model;

import com.example.ntier.model.bll.DeparmentBLL;
import com.example.ntier.model.bll.EmployeeBLL;
import com.example.ntier.model.dal.DepartmentDAL;

public final class DbContext {

	private static DbContext INSTANCE;

	private DeparmentBLL deparments;
	private EmployeeBLL employees;

	private DbContext() {
		this.deparments = new DeparmentBLL();
		this.employees = new EmployeeBLL((DepartmentDAL) deparments.getAbstractDAL());
	}

	public static DbContext getInstance() {
		if (INSTANCE == null) {
			INSTANCE = new DbContext();
		}
		return INSTANCE;
	}

	public DeparmentBLL getDeparments() {
		return deparments;
	}

	public EmployeeBLL getEmployees() {
		return employees;
	}

}
